$(function () {
  let pageNum = 1;
  let figure = 12;
  menuList();
  // 获取菜谱列表
  function menuList() {
    $.ajax({
      method: "GET",
      url: `http://124.223.14.236:3001/api/recipe?pageSize=30&${pageNum}`,
      success: function (res) {
        if (res.status === true) return `获取数据失败`;
        if (res.data.pageSize >= res.data.total) {
          $(".more").hide();
        }
        let htmlStr = template("lead-in", res);
        // 渲染进模板引擎
        $(".list-box").html(htmlStr);
      },
    });
  }
});
